package com.huluobo.a2201mvvm_imdemo.mvvmdemo;

import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModel;

import com.huluobo.a2201mvvm_imdemo.mvpdemo.UserBean;

/**
 * Created by LC on 2024/3/21.
 */
public class LoginViewModel extends ViewModel {
    //登录成功的实参
    MutableLiveData<UserBean> success = new MutableLiveData<>();

    //登录失败的实参
    MutableLiveData<String> failed = new MutableLiveData<>();

    //数据仓库,相当于在P层中new出来的model
    LoginRepo loginRepo = new LoginRepo();

    public void login(String username, String password) {
        loginRepo.login(username, password, success, failed);
    }
}
